# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgbase=python-py3exiv2
pkgname=('python2-py3exiv2' 'python-py3exiv2')
_pkgname=py3exiv2
pkgver=0.12.0
pkgrel=3
pkgdesc='A Python3 binding to the library exiv2'
arch=('x86_64' 'aarch64')
url='https://pypi.org/project/py3exiv2/#files'
license=('GPL3')
makedepends=('python2-setuptools' 'python-setuptools' 'boost')
source=("https://files.pythonhosted.org/packages/source/${_pkgname::1}/$_pkgname/$_pkgname-$pkgver.tar.gz")
sha512sums=('52fe09bebdef065e0b65dba635a1ab1e2c55e49ef7e9277d15f58cd2d8598a755d241a7f3732d53680382127ce3c694f9c519a5e03548b81d43678c705b973ce')

prepare() {
  cp -a "$_pkgname-$pkgver"{,-2}
}

build() {
  cd "$_pkgname-$pkgver-2"

  python2 setup.py build

  cd "$srcdir/$_pkgname-$pkgver"

  python setup.py build
}

package_python2-py3exiv2() {
  depends=('python2')

  cd "$_pkgname-$pkgver-2"

  python2 setup.py install --prefix=/usr --root="$pkgdir" -O1 --skip-build
}

package_python-py3exiv2() {
  depends=('python')

  cd "$_pkgname-$pkgver"

  python setup.py install --prefix=/usr --root="$pkgdir" -O1 --skip-build
}

